package gui.specialGUIs;

import gui.designComponents.TMTNormalButton;
import gui.designComponents.TMTPanel;

import java.awt.BorderLayout;
import java.util.ResourceBundle;

import util.Auth;
import app.Controller;
import app.Model;
import bundles.BundleLoader;
import definitions.Commands;

/**
 * Button Panel to control Event Overview
 * 
 * @author MK
 * 
 */
public class EventOverviewButtonPanel extends TMTPanel {

	public EventOverviewButtonPanel(Model model, Controller controller) {

		ResourceBundle texts = BundleLoader.getResourceBundle();

		Boolean authorized = Auth.getAuthorization(null, model);

		if (authorized) {

			TMTNormalButton newEventButton = new TMTNormalButton(texts
					.getString("createNewEvent"));
			newEventButton.setActionCommand(Commands.SHOW_EVENT_CREATE);
			newEventButton.addActionListener(controller);

			add(newEventButton);

			TMTNormalButton newTraingPlanButton = new TMTNormalButton(texts
					.getString("createNewTrainingPlan"));
			newTraingPlanButton
					.setActionCommand(Commands.SHOW_TRAININGPLAN_CREATE);
			newTraingPlanButton.addActionListener(controller);

			add(newTraingPlanButton);
		}

		TMTNormalButton editMemberButton = new TMTNormalButton(texts
				.getString("editExistingEvent"));
		editMemberButton.setActionCommand(Commands.SHOW_EVENT_UPDATE);
		editMemberButton.addActionListener(controller);

		add(editMemberButton);
	}
}